# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=perl-mime-construct
_pkgreal=mime-construct
pkgver=1.11
pkgrel=9
pkgdesc="Construct and optionally mail MIME messages"
url="https://search.cpan.org/~rosch/mime-construct/mime-construct"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-proc-waitstat perl-mime-types perl-mime-base64"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/R/RO/ROSCH/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="1192c5a0cd1c7675aaf4d1570c910672d3c3b6585f33e4781de289e8e1d9530c17b6d48083ad68349b46faa8e03be1dfeef16701b12763adc36bfa4f3b399a5f  mime-construct-1.11.tar.gz"
